home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.text.*;
-
- public class ScoreManager extends Sprite
- {
-
-
- private var §\x01\x01\x02\t§:* = null;
-
- private var §\x01\x01\x07\x0b§:Boolean = false;
-
- internal const INITARMOR:* = 100;
-
- internal const HEALTHBARY:* = -10;
-
- internal const DOC_HEIGHT:* = 400;
-
- internal const SCOREBARX:* = 445;
-
- internal const SCOREBARY:* = 0;
-
- private var armor:int = 0;
-
- internal const HEALTHBARX:* = 445;
-
- internal const INITSCORE:* = 0;
-
- internal const ARMORBARX:* = 460;
-
- internal const ARMORBARY:* = -40;
-
- internal const INITHEALTH:* = 100;
-
- private var §\x01\x01\x07\r§:TextField;
-
- internal const DOC_TOP:* = 0;
-
- private var §\x01\x01\x07\x0e§:int = 0;
-
- internal const BARWIDTH:* = 160;
-
- private var §\x01\x01\x07\x0f§:* = null;
-
- private var health:int = 0;
-
- internal const DOC_WIDTH:* = 640;
-
- internal const DOC_LEFT:* = 0;
-
- internal const BARHEIGHT:* = 30;
-
- private var §\x01\x01\b\x02§:* = null;
-
- private var §\x01\x01\x06\b§:* = null;
-
- public function ScoreManager(param1:*, param2:*)
- {
- §\x01\x01\x02\t§ = null;
- §\x01\x01\x06\b§ = null;
- §\x01\x01\x07\x0f§ = null;
- §\x01\x01\b\x02§ = null;
- health = 0;
- armor = 0;
- §\x01\x01\x07\x0e§ = 0;
- §\x01\x01\x07\x0b§ = false;
- §\x01\x01\x07\r§ = new TextField();
- super();
- §\x01\x01\x02\t§ = param1;
- §\x01\x01\x06\b§ = param2.GetMenuContainer();
- §\x01\x01\x07\x0b§ = false;
- }
-
- public function GetScore() : int
- {
- return §\x01\x01\x07\x0e§;
- }
-
- public function SetArmor(param1:*) : *
- {
- armor = param1;
- }
-
- public function StopGame() : *
- {
- if(§\x01\x01\x07\x0b§)
- {
- §\x01\x01\b\x01§();
- §\x01\x01\x07\x0b§ = false;
- }
- }
-
- public function SetHealth(param1:*) : *
- {
- health = param1;
- }
-
- private function §\x01\x01\x07\f§() : *
- {
- var _loc1_:TextFormat = null;
- health = INITHEALTH;
- armor = INITARMOR;
- §\x01\x01\x07\x0e§ = INITSCORE;
- §\x01\x01\x07\r§.width = BARWIDTH;
- §\x01\x01\x07\r§.height = BARHEIGHT * 2;
- §\x01\x01\x07\r§.x = SCOREBARX;
- §\x01\x01\x07\r§.y = SCOREBARY;
- §\x01\x01\x07\r§.type = TextFieldType.DYNAMIC;
- §\x01\x01\x07\r§.multiline = true;
- §\x01\x01\x07\r§.wordWrap = true;
- §\x01\x01\x07\r§.background = false;
- §\x01\x01\x07\r§.border = false;
- _loc1_ = new TextFormat();
- _loc1_.font = "Verdana";
- _loc1_.color = 13421772;
- _loc1_.size = 16;
- _loc1_.bold = true;
- _loc1_.align = "right";
- §\x01\x01\x07\r§.defaultTextFormat = _loc1_;
- §\x01\x01\x07\r§.text = "Score: " + §\x01\x01\x07\x0e§;
- §\x01\x01\x06\b§.addChild(§\x01\x01\x07\r§);
- §\x01\x01\x07\x0f§ = new healthbar();
- §\x01\x01\x07\x0f§.x = HEALTHBARX;
- §\x01\x01\x07\x0f§.y = HEALTHBARY;
- §\x01\x01\x07\x0f§.width = BARWIDTH;
- §\x01\x01\x07\x0f§.height = BARHEIGHT;
- §\x01\x01\x06\b§.addChild(§\x01\x01\x07\x0f§);
- §\x01\x01\b\x02§ = new armorbar();
- §\x01\x01\b\x02§.x = ARMORBARX;
- §\x01\x01\b\x02§.y = ARMORBARY;
- §\x01\x01\b\x02§.width = BARWIDTH;
- §\x01\x01\b\x02§.height = BARHEIGHT;
- §\x01\x01\x06\b§.addChild(§\x01\x01\b\x02§);
- §\x01\x01\x02\t§.addEventListener(Event.ENTER_FRAME,§\x01\x01\x07\x10§,false,0,true);
- }
-
- public function StartGame() : *
- {
- if(!§\x01\x01\x07\x0b§)
- {
- §\x01\x01\x07\f§();
- §\x01\x01\x07\x0b§ = true;
- }
- }
-
- public function SetScore(param1:*) : *
- {
- §\x01\x01\x07\x0e§ += param1;
- }
-
- private function §\x01\x01\x07\x10§(param1:Event) : *
- {
- §\x01\x01\x07\x0f§.gotoAndStop(101 - health);
- §\x01\x01\b\x02§.gotoAndStop(101 - armor);
- §\x01\x01\x07\r§.text = "Score: " + §\x01\x01\x07\x0e§++;
- }
-
- private function §\x01\x01\b\x01§() : *
- {
- §\x01\x01\x06\b§.removeChild(§\x01\x01\x07\r§);
- §\x01\x01\x06\b§.removeChild(§\x01\x01\x07\x0f§);
- §\x01\x01\x06\b§.removeChild(§\x01\x01\b\x02§);
- §\x01\x01\x02\t§.removeEventListener(Event.ENTER_FRAME,§\x01\x01\x07\x10§);
- }
- }
- }
-